Skip to content

[mypyc] Add test-only check that IR build doesn't transform a node twice - #22598

Merged
JukkaL merged 1 commit into
masterfrom
mypyc-check-single-accept
Dec 4, 2026
Merged

JukkaL merged 1 commit into
masterfrom
mypyc-check-single-accept

Conversation

@JukkaL

@JukkaL JukkaL commented Dec 4, 2026

Copy link
Copy Markdown
Collaborator

Add the strict_accept_checks compiler option, which makes IRBuilder.accept() assert that no expression or statement is transformed into IR more than once. We've had several bugs because of this.

Also provide an opt-out mechanism in case we really want to transform a node twice.

Enable the check in irbuild and run tests.

Add the strict_accept_checks compiler option, which makes IRBuilder.accept()
assert that no expression or statement is transformed into IR more than
once. We've had several bugs because of this.

Also provide an opt-out mechanism in case we really want to transform
a node twice.

Enable the check in irbuild and run tests.
@JukkaL
JukkaL merged commit c80b4b8 into master Dec 4, 2026
18 checks passed
@JukkaL
JukkaL deleted the mypyc-check-single-accept branch December 4, 2026 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants